﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VehicleRecordSystem.service;

namespace VehicleRecordSystem.view
{
    /// <summary>
    /// Interaction logic for VehicleViewPage.xaml
    /// </summary>
    public partial class VehicleViewPage : Page
    {

        private static VehicleViewPage instanse;
        vrs_vehicle vehicle = new vrs_vehicle();

        public static VehicleViewPage Instanse
        {
            get
            {
                if (instanse == null)
                {
                    instanse = new VehicleViewPage();
                }

                return instanse;
            }
        }
        public VehicleViewPage()
        {
            InitializeComponent();


       }

        private void loadVehicleList()
        {
            

            VehicleService vehicleService = new VehicleService();

            List<vrs_vehicle> vehicleList = vehicleService.viewVehicleList();
            vehicleTb.Items.Clear();

            foreach (vrs_vehicle vehicle in vehicleList)
            {
                vehicleTb.Items.Add(new ListViewItem { Content = vehicle.ID });
            }
        }

        //private void myGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        //{
        //    VehicleDB db = new VehicleDB();

        //    vrs_vehicle vehicle = new vrs_vehicle();

        //    //List<vrs_vehicle> user = db.Vehicle.Select(u => u.USERNAME.Equals(username) && u.PASSWORD.Equals(password)).ToList();
        //}
    }
}
